package com.yz.xyt.mapper;

import com.yz.xyt.domain.Leave;
import com.yz.xyt.domain.vo.LeaveVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface LeaveMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Leave record);

    int insertSelective(Leave record);

    Leave selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Leave record);

    int updateByPrimaryKey(Leave record);

    /**
     * 通用查询
     * @param record
     * @return
     */
    List<Leave> selectBySelective(Leave record);

    /**
     * 查询学生是否在请假过程中
     * @param studentNumber
     * @return
     */
    List<Leave> selectInLeaveByStudentNumber(Integer studentNumber);

    /**
     * 查询学生是否有异常请假
     * @param studentNumber
     * @return
     */
    List<Leave> selectErrorLeaveByStudentNumber(Integer studentNumber);

    /**
     * 查询所有 未审批和审批中 且 无异常 的请假信息
     * @return
     */
    List<Leave> timeoutNotApproval();

    /**
     * 查询所有 请假中 且 无异常 的请假信息
     * @return
     */
    List<Leave> timeoutNotLeave();

    /**
     * 辅导员查询请假列表
     * @return
     */
    List<LeaveVo> selectByFdy(LeaveVo leave);

    /**
     * 书记查询请假列表
     * @param leave
     * @return
     */
    List<LeaveVo> selectBySj(LeaveVo leave);

    /**
     * 学生处查询请假列表
     * @param leave
     * @return
     */
    List<LeaveVo> selectByXsc(LeaveVo leave);

    /**
     * 分管领导查询请假列表
     * @param leave
     * @return
     */
    List<LeaveVo> selectByFgld(LeaveVo leave);

    /**
     * 学生查询请假列表
     * @param leaveVo
     * @return
     */
    List<LeaveVo> selectByStudent(LeaveVo leaveVo);

    List<LeaveVo> selectApprovedListBySj(LeaveVo leaveVo);
    List<LeaveVo> selectApprovedList(LeaveVo leaveVo);
}